package com.yy.wga.income.feign.api;


import com.yy.wga.common.core.dto.Result;
import com.yy.wga.income.feign.request.IncomeUserBalanceListRequest;
import com.yy.wga.income.feign.request.IncomeUserBalanceWithdrawRequest;
import com.yy.wga.income.feign.response.IncomeUserBalanceGetInfoResponse;
import com.yy.wga.income.feign.response.IncomeUserBalanceInfoResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

/**
 * 用户余额
 *
 * @author guochao
 * @since 2024-11-12 00:27:47
 */
@FeignClient(name = "IncomeUserBalanceFeign", url = "https://wga-api.xianrcj.com",
        path = "/api/income/userBalance")
public interface IncomeUserBalanceFeign {

    /**
     * 获取用户余额
     * @return
     */
    @GetMapping("getUserBalance")
    Result<IncomeUserBalanceGetInfoResponse> getUserBalance(@RequestParam("userId") Long userId);

    /**
     * 获取余额
     * @return
     */
    @PostMapping("get")
    Result<List<IncomeUserBalanceInfoResponse>> listByUserId(@RequestBody @Valid IncomeUserBalanceListRequest request);

    /**
     * 提现
     * @return
     */
    @PostMapping("withdraw")
    Result<Boolean> withdraw(@RequestBody @Valid IncomeUserBalanceWithdrawRequest request);
}
